package guiParts;

import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
 
public class PasswordGui {
 
    public String readPassword() {
        JPasswordField passwordField = new JPasswordField(10);
        passwordField.setEchoChar('*');
        JOptionPane.showMessageDialog(
                null,
                passwordField,
                "Enter password",
                JOptionPane.WARNING_MESSAGE);
        return String.valueOf(passwordField.getPassword());
    }
    
}
